<% if @page_link.parent.is_a?(Spree::Store) %>
  <%= turbo_frame_tag spree_dom_id(@page_link), class: 'd-flex align-items-center w-100 py-2 pl-3 pr-2' do %>
    <%= link_to collection_url, class: 'btn-close position-absolute top-0 right-0 mt-2 mr-2' do %>
      <%= icon 'x', class: 'mr-0' %>
    <% end %>
    <%= form_for @page_link, url: spree.admin_page_link_path(@page_link), data: { controller: 'auto-submit' }, html: { class: 'w-100 mt-2 mr-1 mb-2' } do |f| %>
      <%= render 'spree/admin/page_links/form', f: f %>
      <hr class="my-3">
      <%= render 'spree/admin/shared/edit_resource_links', f: f %>
    <% end %>
  <% end %>
<% else %>
  <%= turbo_frame_tag :page_sidebar do %>
    <h6 class="sidebar-header">
      <%= link_to collection_url, data: { action: 'click->page-builder#clearActiveOverlays' }, class: 'btn hover-gray shadow-none px-2' do %>
        <%= icon 'chevron-left', class: 'mr-0' %>
      <% end %>
      <%= @page_link.label %>
    </h6>
    <div class="px-3 pb-5 mb-5 edit-block">
      <%= form_for @page_link, url: spree.admin_page_link_path(@page_link), data: { controller: 'auto-submit' } do |f| %>
        <%= render 'spree/admin/page_links/form', f: f %>
      <% end %>
    </div>
    <div class="sidebar-footer">
      <%= link_to_delete(@page_link, url: spree.admin_page_link_path(@page_link)) %>
    </div>
  <% end %>
<% end %>